<?xml version="1.0" encoding="UTF-8"?>
<ui:composition
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
	template="/WEB-INF/templates/default.xhtml"
>

	<f:metadata>
		<f:viewParam
			name="userId"
			value="#{userHome.id}"
		></f:viewParam>
		<f:event
			listener="#{userHome.initConversation()}"
			type="preRenderView"
		></f:event>
	</f:metadata>

	<ui:define name="head">	
		
	</ui:define>

	<ui:define name="content">
		<h:form id="editForm">
			<p:messages id="messages" />
			<p:panel id="baseInfo" style="margin-bottom:10px;"
				styleClass="nureg-cont nuregcbox nuregcboxsty">
				<h:panelGrid columns="2" cellpadding="5">

					<p:outputLabel for="cnname" value="用户名称" />
					<h:outputText value="#{userHome.instance.cnname}"></h:outputText>
					<p:outputLabel for="cnname" value="用户名称" />
					<p:inputText id="cnname"
						value="#{userHome.instance.username}" required="true"
						 >
						<f:validator binding="#{usernameValidator}"></f:validator>
						<f:ajax render="@this" />
					</p:inputText>


				</h:panelGrid>
			</p:panel>

			<p:commandButton action="#{userHome.editUsername}"
				value="保存" ajax="true" update="@form" />

		</h:form>
	</ui:define>

</ui:composition>
